#!/usr/bin/env bash

image_file_name="usbdisk.img"

if [ -f $image_file_name ]
then
	echo "$image_file_name found."
else
	echo "$image_file_name not found. A new one will be created now..."
	qemu-img create -f qcow2 $image_file_name 512M
	/sbin/mkfs.vfat $image_file_name
fi

./scripts/qemu/auto_qemu \
	-drive id=my_usb_disk,file=$image_file_name,if=none,format=raw \
	-device usb-storage,drive=my_usb_disk \
	"$@"
